Node.js implementation of port detector
Who are using or has used
For more
Usage
$ npm i detect-port --save
const detect = require('detect-port');
detect(port)
.then(_port => {
if (port == _port) {
console.log(`port: ${port} was not occupied`);
} else {
console.log(`port: ${port} was occupied, try port: ${_port}`);
}
})
.catch(err => {
console.log(err);
});
Command Line Tool
$ npm i detect-port -g
Quick Start
$ detect
$ detect 80
$ detect --verbose
$ detect --help
FAQ
Most likely network error, check that your /etc/hosts
and make sure the content below:
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
Contributors
This project follows the git-contributor spec, auto updated at Wed Sep 21 2022 23:10:27 GMT+0800
.
License
MIT